<div class="content-auto">
<div class="breadcrumb">
    <span>(<strong>Inventory</strong>=== Stationery)</span>
</div>
<?php echo form_open('inventory/stationeryUsedEdit',array('class'=>'form-horizontal form-validate','id'=>'frm'));?>
<fieldset>
    <legend><h4><?php echo $title;?></h4></legend>
    <table class="table-form-submit">
        <tr>
            <td><label for="dateused">Date </td>
            <td><input type="text" name="dateused" value="<?php echo $stock['dateused']; ?>" placeholder="used or transfered date" data-date-format="yyyy/mm/dd" class="form-control datepicker" /></td>
        </tr>
        <tr>
            <td><label for="unitused">Unit *</label></td>
            <td><input type="text" name="unitused" value="<?php echo isset($stock['unit']) ? $stock['unit']:''; ?>" placeholder="number of items" class="form-control control-width" required /></td>
        </tr>
        <tr>
            <td><label for="note">Remark</td>
            <td><textarea name="note" class="form-control note"><?php echo $stock['note']; ?></textarea></td>
        </tr>
         <tr>
            <td><label for="status_id">Status</label></td>
            <td>
            <?php
                $data = array(2=>'Used', 3=>'Broken', 4=>'Transfer');
                echo form_dropdown('status_id', $data, $stock['status_id'], 'class="form-control status-select"');
            ?>
            </td>
        </tr>
        <tr class="hidden-broken-tr">
            <td><label class="broken-hidden"  for="notebroken">Note</td>
            <td><textarea name="notebroken" class="form-control broken-hidden note"></textarea></td>
        </tr>
        <tr class="hidden-broken-tr type-tr">
            <td><label class="broken-hidden" for="unitbroken">Unit</label></td>
            <td><input type="text" name="unitbroken" value="<?php echo isset($stock['unitbroken']) ? $stock['unitbroken']:''; ?>" placeholder="Number of items" class="form-control control-width broken-hidden" /></td>     
        </tr>
    <?php if(isset($_SESSION['branch']) && $_SESSION['branch'] == '00HO00') { ?>
        <tr>
            <td><label for="branch_id">Office *</label></td>
            <td>
                <?php echo form_dropdown('branch_id', $branchList,$stock['branch_id'], 'class="form-control" id="branch_id" required') ?>
            </td>
        </tr>
         <tr class="location-tr">
            <td><label for="location_id">Location</label></td>
            <td>
                <?php echo form_dropdown('location_id', $locationList,$stock['location_id'], 'class="form-control" id="location_id"') ?>
            </td>
        </tr>
    <?php } else {
        echo form_hidden('branch_id', $_SESSION['branch']);
    }?>
        <tr>
            <td><label for="staff">Staff</label></td>
            <td><input type="text" name="staff" value="<?php echo isset($stock['staff']) ? $stock['staff']:''; ?>" placeholder="Staff name" class="form-control control-width" /></td>
        </tr>
        <tr>
            <td>
            </td>
            <td>
                <?php 
                echo form_hidden('stock_id',$stock['stock_id']); 
                echo form_hidden('item_id', $stock['item_id']);
                echo form_hidden('cpu', $stock['cpu']);
                echo form_hidden('status', $stock['status_id']);
                ?>
                <?php echo $form; ?>
            </td>
        </tr>
    </table>
 </fieldset> 
<?php echo form_close();?>
</div>